#!/bin/sh
TOUCH=/bin/touch
RM=/bin/rm
PATH_NAME=/tmp/$_CRS_NAME

#
# These messages goes into the CRSD agent log file.
echo " *******   `date` ********** " 
echo "Action script '$_CRS_ACTION_SCRIPT' for resource[$_CRS_NAME] called for action $1"
#

case "$1" in
  'start')
     echo "START entry point has been called.." 
     echo "Creating the file: $PATH_NAME" 
     $TOUCH $PATH_NAME
     exit 0
     ;;

  'stop')
     echo "STOP entry point has been called.." 
     echo "Deleting the file: $PATH_NAME" 
     $RM $PATH_NAME
     exit 0
     ;;

  'check')
    echo "CHECK entry point has been called.." 
    if [ -e $PATH_NAME ]; then
        echo "Check -- SUCCESS" 
        exit 0
    else 
        echo "Check -- FAILED" 
        exit 1
    fi
    ;;

  'clean')
     echo "CLEAN entry point has been called.." 
     echo "Deleting the file: $PATH_NAME" 
     $RM -f $PATH_NAME
     exit 0
     ;;

esac



